package com.dodo.videoEdit.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.dodo.videoEdit.greendao.Audio;
import com.dodo.videoEdit.greendao.FileDirType;
import com.dodo.videoEdit.greendao.Image;
import com.dodo.videoEdit.greendao.Video;

import com.dodo.videoEdit.greendao.AudioDao;
import com.dodo.videoEdit.greendao.FileDirTypeDao;
import com.dodo.videoEdit.greendao.ImageDao;
import com.dodo.videoEdit.greendao.VideoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig audioDaoConfig;
    private final DaoConfig fileDirTypeDaoConfig;
    private final DaoConfig imageDaoConfig;
    private final DaoConfig videoDaoConfig;

    private final AudioDao audioDao;
    private final FileDirTypeDao fileDirTypeDao;
    private final ImageDao imageDao;
    private final VideoDao videoDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        audioDaoConfig = daoConfigMap.get(AudioDao.class).clone();
        audioDaoConfig.initIdentityScope(type);

        fileDirTypeDaoConfig = daoConfigMap.get(FileDirTypeDao.class).clone();
        fileDirTypeDaoConfig.initIdentityScope(type);

        imageDaoConfig = daoConfigMap.get(ImageDao.class).clone();
        imageDaoConfig.initIdentityScope(type);

        videoDaoConfig = daoConfigMap.get(VideoDao.class).clone();
        videoDaoConfig.initIdentityScope(type);

        audioDao = new AudioDao(audioDaoConfig, this);
        fileDirTypeDao = new FileDirTypeDao(fileDirTypeDaoConfig, this);
        imageDao = new ImageDao(imageDaoConfig, this);
        videoDao = new VideoDao(videoDaoConfig, this);

        registerDao(Audio.class, audioDao);
        registerDao(FileDirType.class, fileDirTypeDao);
        registerDao(Image.class, imageDao);
        registerDao(Video.class, videoDao);
    }
    
    public void clear() {
        audioDaoConfig.clearIdentityScope();
        fileDirTypeDaoConfig.clearIdentityScope();
        imageDaoConfig.clearIdentityScope();
        videoDaoConfig.clearIdentityScope();
    }

    public AudioDao getAudioDao() {
        return audioDao;
    }

    public FileDirTypeDao getFileDirTypeDao() {
        return fileDirTypeDao;
    }

    public ImageDao getImageDao() {
        return imageDao;
    }

    public VideoDao getVideoDao() {
        return videoDao;
    }

}
